package fei.zhou.lambdalearn.demo5;

import java.util.function.Predicate;

/**
 * 描述该类- JPA
 *
 * @author zhoufei
 * @class: Toshow
 * @date 2020/12/22 20:49
 * @Verson 1.0 -2020/12/22 20:49
 * @see
 */
public class Demo1 {
    
    public static void main(String[] args) {
        boolean b1 = checkString("A", (String s) -> {
            return s.equals("A");
        });
        
        System.out.println("b1：" + b1);
        
        boolean b2 = checkString("B", (String s) -> {
            return s.equals("A");
        });
        System.out.println("b2：" + b2);

    }
    // 逻辑非操作
    private static boolean checkString(String s, Predicate<String> pre) {
        // return pre.test(s);
        // return !pre.test(s);
        return pre.negate().test(s);
    }
}